package com.utils;


import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * 转换JSON格式
 * 
 */
public class GsonParse {

	private static String TAG = GsonParse.class.getSimpleName();

	///*
	public static Object parse(String content, Class cls) {
		
		GsonBuilder gsBuilder = new GsonBuilder();
		Gson gson = gsBuilder.create();
		Object c = gson.fromJson(content, cls);
		return c;

	}
	//*/

	public static String parse(Object content) {

		GsonBuilder gsBuilder = new GsonBuilder();
		Gson gson = gsBuilder.create();
		return gson.toJson(content);

	}



}
